' https://rosettacode.org/wiki/Julia_set#Locomotive_Basic
screen _newimage(640,400,12) ' ๐ a custom screen setting
2 FOR xp = 0 TO 639
3 FOR yp = 0 TO 399
4 x0 = -0.512511498387847167 : y0 = 0.521295573094847167
5 x = xp / 213 - 1.5 : y = yp / 200 - 1
6 iteration = 0
7 maxIteration = 100
8 WHILE (x * x + y * y <= (2 * 2) AND iteration < maxIteration)
9 xtemp = x * x - y * y + x0
10 y = 2 * x * y + y0
11 x = xtemp
12 iteration = iteration + 1
13 WEND
14 IF iteration <> maxIteration THEN c = iteration ELSE c = 0
' ๐ 'BAM does not have the PLOT statement: 15 PLOT xp, yp, c MOD 16
15 pset (xp, yp), c MOD 16
16 NEXT
17 NEXT